<script setup>
const handleSelect = (index,indexPath) => {
  console.log(index,indexPath)
}
</script>

<template>
<h1>菜单组件</h1>
  <el-menu mode="horizontal" active-text-color="yellow" background-color="blue" text-color="white" @select="handleSelect">
    <el-menu-item index="1">首页</el-menu-item>
    <el-menu-item index="2">免费课</el-menu-item>
    <el-menu-item index="3">直播课</el-menu-item>
    <el-menu-item index="4">精品课</el-menu-item>
    <el-menu-item index="5">线上班</el-menu-item>
    <el-sub-menu index="6">
      <template #title>线下班</template>
      <el-menu-item index="6-1">Java1</el-menu-item>
      <el-menu-item index="6-2">Java2</el-menu-item>
      <el-menu-item index="6-3">Java3</el-menu-item>
      <el-menu-item index="6-4">Java4</el-menu-item>
    </el-sub-menu>
  </el-menu>
</template>

<style scoped>

</style>